local skill = fk.CreateSkill {
  name = "#ling__general_bow_skill",
  tags = { Skill.Compulsory },
  attached_equip = "ling__general_bow",
}

Fk:loadTranslationTable{
  ["#ling__general_bow_skill"] = "将军弩",
}

skill:addEffect(fk.Deathed, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skill.name) and data.damage and data.damage.from == player and
      data.damage.card and data.damage.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, 1)
    if not player.dead then
      room:recover{
        who = player,
        num = 1,
        recoverBy = player,
        skillName = skill.name,
      }
    end
  end,
})

return skill
